//
//  AirSurfaceEngine.h
//  AirSurfaceKit
//
//  Created by limu on 16/5/3.
//  Copyright © 2016年 SimuTech. All rights reserved.
//

#import <Foundation/Foundation.h>

//鉴权结果状态码
typedef enum {
    PermissionCheck_Connect_Error = -300,   // 链接服务器错误
    PermissionCheck_Data_Error = -200,      // 服务返回数据异常
    PermissionCheck_OK = 0,                 // 授权验证通过
    PermissionCheck_Key_Error = 101,        // key不存在
    PermissionCheck_Code_Error = 102,       // Code异常
    PermissionCheck_Time_Expiration = 200,	// 过期
    PermissionCheck_Key_Forbiden = 201,     // key被用户自己禁用，请在控制台解禁
} AirSurfacePermissionCheckResultCode;

///通知Delegate
@protocol AirSurfaceGeneralDelegate <NSObject>
@optional
/**
 *返回网络错误
 *@param iError 错误号
 */
- (void)onGetNetworkState:(AirSurfacePermissionCheckResultCode)iError;

/**
 *返回授权验证错误
 *@param iError 错误号 : 为0时验证通过
 */
- (void)onGetPermissionState:(AirSurfacePermissionCheckResultCode)iError;
@end

@interface AirSurfaceEngine : NSObject
/**
 *  启动渲染管理器
 *
 *  @param key      序列号
 *  @param delegate 代理协议
 *
 *  @return 启动状态
 */
- (BOOL)start:(NSString*)key generalDelegate:(id<AirSurfaceGeneralDelegate>)delegate;
@end
